package com.zoshine.zzg.service;

import com.zoshine.zzg.dao.SupplierSettlementDao;
import com.zoshine.zzg.exception.AppException;
import com.zoshine.zzg.exception.ErrorMessage;
import com.zoshine.zzg.pojo.SupplierSettlement;
import com.zoshine.zzg.pojo.pojostatus.SettlementStatus;
import com.zoshine.zzg.util.idworker.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
@Transactional
public class SupplierSettlementService extends BaseService<SupplierSettlement> {
//
//    private SupplierSettlementDao supplierSettlementDao;
//    private IdWorker<Long> settlementIdWork;
//    @Autowired
//    public void setSupplierSettlementDao(SupplierSettlementDao supplierSettlementDao) {
//        this.supplierSettlementDao = supplierSettlementDao;
//    }
//    @Autowired
//    public void setSettlementIdWork(IdWorker<Long> settlementIdWork) {
//        this.settlementIdWork = settlementIdWork;
//    }
//
//    @Override
//    public void delSupplierSettlement(Long settlementId) {
//        if(settlementId == null){
//            throw new AppException(ErrorMessage.SETTLEMENT_ID_CAN_NOT_NULL);
//        }
//        supplierSettlementDao.delete(settlementId);
//    }
//
//    @Override
//    public void addSupplierSettlement(SupplierSettlement supplierSettlement) {
//
//        supplierSettlement.setSettlementId(settlementIdWork.createId());
//        supplierSettlement.setStatus(SettlementStatus.PENDINGRECEIVE.getValue());
//        supplierSettlement.setCreateTime(new Date());
//        supplierSettlement.setUpdateTime(new Date());
//        supplierSettlementDao.insert(supplierSettlement);
//    }
//
//    @Override
//    public SupplierSettlement getSupplierSettlement(Long settlementId) {
//        if(settlementId == null){
//            throw new AppException(ErrorMessage.SETTLEMENT_ID_CAN_NOT_NULL);
//        }
//        return supplierSettlementDao.selectOne(settlementId);
//    }
//
//    @Override
//    public void editSupplierSettlement(SupplierSettlement supplierSettlement) {
//        supplierSettlementDao.update(supplierSettlement);
//    }
//
//    @Override
//    public List<SupplierSettlement> listSupplierSettlement(SupplierSettlement supplierSettlement) {
//        return supplierSettlementDao.selectList(supplierSettlement);
//    }

}
